﻿using System.Windows.Forms;
using WinForm.Common;

namespace WinForm.Helper
{
    public class MyMessageBox
    {
        /// <summary>
        /// 提示对话框
        /// </summary>
        /// <param name="msg">消息内容</param>
        public static void ShowMessageBoxInfo(string msg)
        {
            //new FrmMessageBox(MessageBoxStyle.info, msg).ShowDialog();
            MessageBox.Show(msg, "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }

        /// <summary>
        /// 错误对话框
        /// </summary>
        /// <param name="msg">消息内容</param>
        public static void ShowMessageBoxError(string msg)
        {
            //new FrmMessageBox(MessageBoxStyle.error, msg).ShowDialog();
            MessageBox.Show(msg, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }

        /// <summary>
        /// 询问对话框
        /// </summary>
        /// <param name="msg">消息内容</param>
        /// <returns></returns>
        public static System.Windows.Forms.DialogResult ShowMessageBoxQuestion(string msg)
        {
            //return new FrmMessageBox(MessageBoxStyle.question, msg).ShowDialog();
            return MessageBox.Show(msg, "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
        }
    }
}
